home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 11 / Info-Mac_XI_Disc_1.cdr_ / Info-Mac XI Disc 1.cdr / Programs / Disk & File / touchMe 1.1.2 / sample scripts / sample 2 < prev    next >
Encoding:
Text File  |  1997-02-10  |  729 b   |  22 lines  |  [TEXT/ToyS]

  1. -- Sample AppleScripts for touchMe, 1996 (C) Mizutori Tetsuya
  2. -- An applet to change the date time stamp of the given folder
  3. -- to the newest one of the items contained in the folder.
  4. -- Let's start to open a target folder!
  5.  
  6. set theFolder to (choose folder)
  7.  
  8. tell application "Finder"
  9.     sort items of theFolder by modification date
  10.     set theNewest to the first item of the result
  11.     set theCreationDate to the creation date of theNewest
  12.     set theModificationDate to the modification date of theNewest
  13. end tell
  14.  
  15. tell application "touchMe"
  16.     activate
  17.     set prefs creation to {enabled:true, flag:exact, value:theCreationDate}
  18.     set prefs modification to {enabled:true, flag:exact, value:theModificationDate}
  19.     touch theFolder
  20.     quit
  21. end tell
  22.